// 导入封装的axios
import axios from "@/utils/http";
// 导入封装的接口地址
import * as baseURL from "@/api/url";

// 表示根据老人用户id查询家属的用户接口地址
export const getFamilyAPI = (params) => {
    const url = baseURL.family_get_url.replace(':elderId', params.elderId);
    return axios({
        url: url,
        method: "get",
        params,
    });
};

//注册
export const registerAPI = (data) => {
    return axios({
        url: baseURL.elder_register_url,
        method: "post",
        data,
    });
};

//获取状态
export const stateAPI = (params) => {
    return axios({
        url: baseURL.elder_state_url,
        method: "get",
        params,
    });
};
//入住登记
export const checkinAPI = (data) => {
    return axios({
        url: baseURL.elder_checkin_url,
        method: "post",
        data,
    });
};
//入住登记查询
export const findCheckinAPI = (params) => {
    return axios({
        url: baseURL.elder_findCheckin_url,
        method: "get",
        params,
    });
};
// 表示根据老人账户id查询老人的接口地址
export const getElderAPI = (params) => {
    const url = baseURL.elder_getbyacc_url.replace(':accId', params.accId);
    return axios({
        url: url,
        method: "get",
        params,
    });
};
// 表示根据护理人员id查询老人的接口地址
export const getElderByNurseAPI = (params) => {
    const url = baseURL.elder_getbynurse_url.replace(':nurseId', params.nurseId);
    return axios({
        url: url,
        method: "get",
        params,
    });
};

// 根据老人Id查询健康信息
export const getHealthAPI = (params) => {
    const url = baseURL.health_getbyeld_url.replace(':elderId', params.elderId);
    return axios({
        url: url,
        method: "get",
        params,
    });
};
// 根据修改健康信息
export const modifyHealthAPI = (data) => {
    const url = baseURL.health_edit_url;
    return axios({
        url: url,
        method: "post",
        data,
    });
};
// 创建健康信息
export const addHealthAPI = (data) => {
    const url = baseURL.health_create_url;
    return axios({
        url: url,
        method: "post",
        data,
    });
};
// 修改老人信息
export const editEldAPI = (data) => {
    return axios({
        url: baseURL.elder_edit_url,
        method: "post",
        data
    })
  }
// 表示根修改家属的接口地址
export const editFamilyAPI = (data) => {
    const url = baseURL.family_edit_url;
    return axios({
        url: url,
        method: "post",
        data,
    });
};
// 表示添加家属的接口地址
export const addFamilyAPI = (data) => {
    const url = baseURL.family_add_url;
    return axios({
        url: url,
        method: "post",
        data,
    });
};